/**
 * 
 */
package neptune.web.client.view.components.editor;

import neptune.web.client.model.topology.SerializableIPAddress;
import neptune.web.client.model.topology.SerializableNetworkInterface;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.TreeItem;

/**
 * @author Roberto Bifulco [RobertoBifulco.it] [info@robertoBifulco.it]
 *
 */
public class RemoveIpAddrCommand implements Command {

	private SerializableIPAddress ipAddr;
	private SerializableNetworkInterface netIf;
	private TreeItem item;

	public RemoveIpAddrCommand(SerializableIPAddress ipAddr,
			SerializableNetworkInterface netIf, TreeItem item) {
		this.ipAddr = ipAddr;
		this.netIf = netIf;
		this.item = item;
	}

	/* (non-Javadoc)
	 * @see com.google.gwt.user.client.Command#execute()
	 */
	public void execute() {
		netIf.removeIpAddress(ipAddr);
		item.remove();
	}

}
